home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1994 November / macformat-018.iso / Utility Spectacular / Developer / macgzip_022-src / macos / Posix / ThinkCPosix Sources / fpathconf.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-07-26  |  717 b   |  35 lines  |  [TEXT/MPS ]

  1. /* $ld: $ */
  2.  
  3. #include "ThinkCPosix.h"
  4.  
  5. long fpathconf(fd, name)
  6. int fd;                /* file descriptor being interrogated */
  7. int name;            /* property being inspected */
  8. {
  9. /* POSIX allows some of the values in <limits.h> to be increased at
  10.  * run time.  The pathconf and fpathconf functions allow these values
  11.  * to be checked at run time.  We do not use this facility.
  12.  */
  13.  
  14.   struct stat stbuf;
  15.  
  16.   switch(name) {
  17.  
  18.     case _PC_NAME_MAX:
  19.         return( (long) NAME_MAX);
  20.  
  21.     case _PC_PATH_MAX:
  22.         return( (long) PATH_MAX);
  23.  
  24.     case _PC_CHOWN_RESTRICTED:
  25.         return( (long) 0);    /* We do not define CHOWN_RESTRICTED */
  26.  
  27.     case _PC_NO_TRUNC:        /* We do not define NO_TRUNC */
  28.         return( (long) 0);
  29.  
  30.     default:
  31.         errno = EINVAL;
  32.         return(-1L);
  33.   }
  34. }
  35.